This file contains the current logging format specification, as well as the format change history.

A log is a file in plan text format, consisting of several Entries. Each Entry is represented by one and only one line in the file. Every Entry consists of several Fields, but the number of Fields is NOT the same for every Entry. The different fields are seperated by the '|' character.

The first three fields always hold the same kind of data (counting C-style, starting at 0 not 1):
FIELD		DATA
0		Timestamp
1		Level
2		Component

Timestamp is the time the entry was added to the log. Time is measured in Milliseconds, counting from program startup.
Level is the entry importancy. The different Levels are listed later.
Component is the part of the game the entry belongs to. This will get clearer later, when the different components are listed.

Example:
7931|INFO|UNIT

The meaning of the next fields depends on the Component, as some components will require a House and ID field, to make clear to what player or unit the Entry belongs to if that information is applicable. After those fields, if they're needed, the Event is specified. The meaning of an Event will be explained later.
So, depending on the component, the first fields will hold this information:

FIELD		DATA
0		Timestamp
1		Level
2		Component
3		House
4		ID
5		Event

OR:

FIELD		DATA
0		Timestamp
1		Level
2		Component
3		Event

Example:
7931|INFO|UNIT|ORDOS|63|MOVE
OR
161|INFO|ALLEGRO|Allegro init

To avoid confusion, fields numbered using E+'X' means the field 'X' fields after Event. So field E+0 is the Event field itself, E+1 is the first field after the Event field.

The existence of two fields, Message and Outcome, depend on the Event. Because of their frequent use they're described here rather than in every seperate Event description. However, every Event description will state if it uses these fields.

The Message fields hold a String describing the event shortly in a human-readable way. An example: When reading a file, the message field might contain "Reading file game.ini".
The Outcome field holds either SUCCES, FAILED, NONE, or UNKNOWN. The meaning of these should be self-explanatory.

After these fields come the Event specific fields, which will be described in the Event descriptions.



Level Descriptions

The entry Level is an indication of the Entry importancy. This can be used to instruct the game to only log messages with a high enough importancy, or in the viewer to filter entry's according to importancy.
The different Levels are (from low to high importancy):

INFO
TRACE
WARN
ERROR
FATAL



Component Descriptions

The Component describes from what part of the game the entry originates. The different Components are:

Component		Has House	Has ID		Description

UNITS			X		X
STRUCTURES		X		X
GAMEINI							Events concerning the game.ini file, the game settings
SCENARIOINI						Events concerning the scenario ini's, the files about the campaign game
PARTICLE				
BULLET					
AI			X		X
SIDEBAR			
MAP
NONE							Used for the old Log messages, so all entry's using this component should be changed
INIT							Used for Battle Initaialization
ALLEGRO							Use for allegro specific calls
SETUP							Used for Program Startup
VERSION							Version specific log messages
SKIRMISHSETUP 		X		X		When skirmish game is being set up
ALFONT							ALFONT library specific Events
SOUND							Sound related Events



Component Events

There are many different Events, but not every Event is usable for every Component. First, a list of the Events available for every Component is given. After  this list, the details of the different Events are listed.

Component		Events

UNITS			CREATED
			DESTROYED
			DESTROYS
			MOVE
			ATTACK
			HIT
			HITS
			SHOOTS
			HARVEST
			DEPLOY
			VETERANCY
			REPAIR
			
STRUCTURES		CREATED
			CREATES
			CREATE
			DESTROYED
			DESTROYS
			ATTACK
			HIT
			HITS
			SHOOTS
			UPGRADE
			ORDER
			REPAIR
			REPAIRING

GAMEINI			

SCENARIOINI

PARTICLE

BULLET

AI

SIDEBAR

MAP

NONE			Default log message (CHANGEME)

INIT			

ALLEGRO			Allegro init
			Initializing timer functions
			Initializing ALFONT
			Initializing Allegro Keyboard
			Initializing Allegro Mouse
			Set up timer related variables
			Set up window title

SETUP			Initializing

VERSION			Initializing

SKIRMISHSETUP

ALFONT

SOUND



Event Details

Event			Field			Type	Description

CREATED							Subject was created
			ID (E+1)		int	The ID of the subject
			Owner (E+2)		int	The ID of the owning player
			Cell (E+3)		int	The cell at which the subject has been created

CREATES							Subject has created something
			Creation ID (E+1)	int	The ID of the subject's creation

CREATE							Subject is ordered to create something
			Description (E+1)	string	A String representation of the object the subject is ordered to create
			Time (E+2)		int	The time the creating process should take
			Cost (E+3)		int	The cost of the creation

DESTROYED						Subject was destroyed
			Killer ID (E+1)		int	The ID of the killer

DESTROYS						Subject has destroyed something
			Victim ID (E+1)		int	The ID of the victim
			Experience (E+2)	float	The amount of experience gained

MOVE							Subject is ordered to move
			OUTCOME			OUTC	The outcome field is used here to indicate if the subject can move to the requested target location
			Cell (E+1)		int	The current cell of the unit
			Target (E+2)		int	The target cell of the unit

ATTACK							Subject is ordered to attack
			Target (E+1)		int	The ID of the target, -1 if attacking ground
			Target Cell (E+2)	int	The location of the target. Useful for attack ground

HIT							Subject has been hit
			Attacker (E+1)		int	Attacker ID
			Damage (E+2)		float	Lost health percentage

HITS							Subject has hit something
			Victim (E+1)		int	ID of the object being hit
			Damage (E+2)		float	The percentage of damage dealt by the subject

SHOOTS							Subject shoots

UPGRADE							Subject is being upgraded
			Cost (E+1)		int	The cost of the upgrade
			Time (E+2)		int	The time the upgrade should take
			Tech Level (E+3)	int	The new Tech Level

HARVEST							Subject is ordered to harvest
			Cell (E+1)		int	The subject's current cell
			Target (E+2)		int	The location of the spice to harvest

DEPLOY							Subject is ordered to deploy
			Cell (E+1)		int	The location where the subject is deploying

VETERANCY						Subject has a new rank
			Rank (E+1)		int	The new rank of the subject

REPAIR							Unit is ordered to get repaired, or repair facility is repairing Unit
			Unit ID (E+1)		int	The ID of the unit being repaired
			Cost (E+2)		int	The repairing cost
			Time (E+3)		int	The time the repair process will take

ORDER							Starport has ordered units
			Descriptions (E+1)	string	The descriptions of the ordered units, seperated by comma
			Cost (E+2)		string	The prices of the ordered units, seperated by comma

REPAIRING						Structure is being repaired

Allegro init						Allegro is initializing
			Message (E+1)		MSG
			Outcome (E+2)		OUTC

Initializing timer functions				Allegro timer is initializing
			Message (E+1)		MSG
			Outcome (E+2)		OUTC

Initializing ALFONT					ALFONT is initializing
			Message (E+1)		MSG
			Outcome (E+2)		OUTC

Initializing Allegro Keyboard				Keyboard is initializing
			Message (E+1)		MSG
			Outcome (E+2)		OUTC

Initializing Allegro Mouse				Mouse is initializing
			Message (E+1)		MSG
			Outcome (E+2)		OUTC

Set up timer related variables				Timer variables are initializing
			Message (E+1)		MSG
			Outcome (E+2)		OUTC

Set up window title					Window is getting its title
			Message (E+1)		MSG
			Outcome (E+2)		OUTC

Initializing						The subject is initializing
			Message (E+1)		MSG
			Outcome (E+2)		OUTC




























